package threeRegInstructions;


import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import main.IMIPSInstruction;


public abstract class MIPSThreeRegInstruction implements IMIPSInstruction {
	String myRegisterOne;
	String myRegisterTwo;
	String myRegisterThree;
	String myName;
	protected static Properties myRecognizedRegisters = new Properties();

	public MIPSThreeRegInstruction(String input) throws FileNotFoundException,
			IOException {
		myRecognizedRegisters.load(new FileInputStream(new File(
				"recognizedRegisters.properties")));
		myRegisterOne = myRecognizedRegisters.getProperty(input.substring(16,
				21));
		myRegisterTwo = myRecognizedRegisters.getProperty(input
				.substring(6, 11));
		myRegisterThree = myRecognizedRegisters.getProperty(input.substring(11,
				16));
	}
	public MIPSThreeRegInstruction(){
		
	}
	
	public String toString(){
		return myName + " " + myRegisterOne +", " + myRegisterTwo + ", " + myRegisterThree;
	}
}
